package com.huluobo.a2107mvpimdemo.chat;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.huluobo.a2107mvpimdemo.R;
import com.hyphenate.easeui.modules.chat.EaseChatFragment;

public class ChatActivity extends AppCompatActivity {
    private ChatFragment chatFragment;
    private TextView title;
    private ImageView back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat);

        back   = findViewById(R.id.header_back);
        back.setVisibility(View.VISIBLE);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        title = findViewById(R.id.header_title);
        title.setText(getIntent().getExtras().getString("conversationId"));

        chatFragment = new ChatFragment();
        chatFragment.setArguments(getIntent().getExtras());//传递联系人数据
        getSupportFragmentManager().beginTransaction().add(R.id.chat_container, chatFragment).commit();

    }
}